home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple II Magazines (PO)
/
Nibble Volume 12, No. 02 (1991-02)(MindCraft Publishing)(Side A).zip
/
Nibble Volume 12, No. 02 (1991-02)(MindCraft Publishing)(Side A).po
/
SUPERTRACE.S
< prev
Wrap
Text File
|
1996-12-24
|
41KB
|
757 lines
KEEP SUPERTRACE Name the binary file
SYMBOL OFF Symbol listing off
65816 OFF Include these if using
65C02 OFF Orca/M-GS
ORG $2000
MAIN START
****************************************************************
* SUPERTRACE Source Code
* by Gary Ash
* Copyright 1991 by
* MindCraft Publishing Corp.
* Concord, MA 01742
* ORCA/M Macro Assembler
****************************************************************
*
TVAR GEQU $00 Trace variable flag
TRAP GEQU $01 Trap number storage
LASTLN GEQU $02 Last line exucuted
CH GEQU $24 Cursor horizontal
CV GEQU $25 Cursor vertical
PROMPT GEQU $33 System's prompt char
CSW GEQU $36 Char output vector
KSW GEQU $38 Char input vector
MOVST GEQU $3C Start of block
MOVEND GEQU $3E End of block
MOVDST GEQU $42 Destination
HIMEM GEQU $73 Applesoft HIMEM
CURLIN GEQU $75 Current line number
FAC GEQU $9D Floating pnt accum
DSCTMP GEQU $9D Keyword table pointer
TXTPTR GEQU $B8 Program text pointer
POINT GEQU $B1 CHRGET patch point
REENTRY GEQU $B7 CHRGET re-entry point
SPDBYTE GEQU $F1 Applesoft output speed
STACKPTR GEQU $F8 Applesoft stack pointer
TEMP GEQU $FA Temporary storage
YREG GEQU $FF Save for (Y)
INBUF GEQU $200 Keyboard input buffer
WARMST GEQU $3D0 System warm start entry
DOSHOOK GEQU $3EA Hookup DOS
SOFTEV GEQU $3F2 Soft RESET vector
VECTIN GEQU $BE32 BASIC.SYSTEM input vector
GETBUF GEQU $BEF5 Allocate buffer space
FREEBUF GEQU $BEF8 Free up buffer space
INLIN GEQU $D52C Input a line of text
FIXUP GEQU $D539 Fixup for tokenizer
PARSE GEQU $D559 Tokenize input buffer
KEYCHR GEQU $D72C Get a keyword char
ADDON GEQU $D998 Add Y to text pointer
PRINT GEQU $DAD5 PRINT command action
CRDO GEQU $DAFB Print out a CR
STROUT GEQU $DB3A Output a string
OUTSP GEQU $DB57 Print out a space
OUTDO GEQU $DB5C Print out a char
FRMEVL GEQU $DD7B Evaluate expression
INPRT GEQU $ED19 Print IN (current line)
LINPRT GEQU $ED20 Print the line number
PRDEC GEQU $ED24 Print a number X/A
SETTXT GEQU $FB39 Set text screen mode
TABV GEQU $FB5B Set a vertical tab
SETPWRC GEQU $FB6F Set powerup checksum
HOME GEQU $FC58 Clear the screen
CLREOP GEQU $FC42 Clear to end of page
WAIT GEQU $FCA8 Time delay routine
RDKEY GEQU $FD0C Read a keypress
KEYIN GEQU $FD1B Read the keyboard
GETLIN GEQU $FD6F Get a line of text
COUT1 GEQU $FDF0 Char output routine
MOVE GEQU $FE2C Move a block of memory
SETINV GEQU $FE80 Set INVERSE video
SETNORM GEQU $FE84 Set NORMAL video mode
SETKBD GEQU $FE89 Set normal KSW vector
SETVID GEQU $FE93 Set 40-column video
BELL GEQU $FF3A Sound the error bell
RESTORE GEQU $FF3F Restore registers
STORE GEQU $FF4A Store registers
****************************************************************
*
* Super TRACE installation routine
*
****************************************************************
*
JSR SETTXT Set text screen
JSR HOME Clear the screen
LDA #CREDITS Setup so STROUT will
LDY #>CREDITS
JSR STROUT Print the credits
LDX #SUPER Get the starting address
LDA #>SUPER of the main program code
STX MOVST Setup the start of block
STA MOVST+1 to move parameter
LDX #END Get the ending address
LDA #>END of the main program
STX MOVEND Setup the end of block
STA MOVEND+1 to move parameter
LDX #KBDIN Get the destination address
LDA #>KBDIN of the main program code
STX MOVDST Setup the destination
STA MOVDST+1 address parameter
LDY #$00 Zero Y for MOVE call
JSR MOVE Move Super TRACE into place
STY TVAR No trace variable
JSR PATCH Patch CHRGET routine
LDX #RESET Get the address of the
LDA #>RESET Control RESET trap
STX SOFTEV Setup the system
STA SOFTEV+1 RESET vector
JSR SETPWRC Validate the vector change
LDX #KBDIN Get the address of the
LDA #>KBDIN keyboard intecepter
STX KSW Setup the zero page
STA KSW+1 input vector address
LDY $BF00 Check the DOS
CPY #$4C $BF00=$4C if ProDOS
BNE INSTALL1 No ProDOS, DOS 3.3
STX VECTIN Tell BASIC.SYSTEM where
STA VECTIN+1 our input routine is
JSR FREEBUF Freeup buffer space
LDA #$0D Ask BASIC.SYSTEM for
JSR GETBUF 13 memory pages
JMP WARMST Exit to Applesoft
INSTALL1 STX HIMEM Lower HIMEM to protect
STA HIMEM+1 the program from BASIC
JSR DOSHOOK Hookup DOS
JMP WARMST
CREDITS DC H'0D0A',C'SUPER TRACE BY GARY ASH',H'0D0A'
DC C'(C) 1991 MINDCRAFT PUBL. CORP.',H'8D8A00'
****************************************************************
*
* SuperTRACE main program code
*
****************************************************************
*
SUPER ANOP
OBJ $8D00 Main program's origin
****************************************************************
*
* Keyboard intercepter routine
*
****************************************************************
*
KBDIN ANOP
STY TEMP Save Y register
JSR KEYIN Read a keypress
LDY PROMPT See if system is in
CPY #']'+$80 Applesoft direct mode
BEQ KBDIN2 Yep, check for command
KBDIN1 LDY TEMP Restore Y register
RTS Exit with keypress
KBDIN2 LDY #$05 There are 6 commands
KBDIN3 CMP CMDSTBL,Y This loop compares the
BEQ KBDIN4 keypress against a table
DEY of SUPERTRACE commands
BPL KBDIN3 Check against whole table
BMI KBDIN1 Keypress isn't a command
KBDIN4 TYA This stuff computes the
ASL A index into the command
TAY handler address table
LDA ADRTBL+1,Y Get the handler's address
PHA and push it on the stack
LDA ADRTBL,Y so we can use an RTS instr
PHA to make the call (Fake a
RTS return from subroutine)
****************************************************************
*
* Control RESET trapping routine
*
****************************************************************
*
RESET ANOP
JSR CRDO Makes screen prettier
JSR PATCH Make sure CHRGET is patched
LDX #KBDIN Get the address of the
LDA #>KBDIN keyboard intercepter
STX KSW Make sure we're hooked
STA KSW+1 into the I/O loop
JMP WARMST WARMST makes vector stick
****************************************************************
*
* Program execution monitor routine
*
****************************************************************
*
MONIT JSR STORE Save the registers
LDA TXTPTR+1 Is a program executing?
CMP #$08 Yes, if TXTPTR=> then $08
BCS MONIT3 Program is running
LDA CURLIN Update LASTLN variable
STA LASTLN
LDA CURLIN+1
STA LASTLN+1
MONIT1 INC TXTPTR Point TXTPTR to the
BNE MONIT2 next program char
INC TXTPTR+1
MONIT2 JSR RESTORE Restore entry registers
JMP REENTRY Re-enter CHRGET code
MONIT3 LDX #$00 Save the current
MONIT4 LDA $00,X zero page values
STA ZPAGE,X in their own buffer
INX to prevent the
BNE MONIT4 BASIC program from
! being bombed out
LDY #39 Save bottom line of
SAVLOOP LDA $7D0,Y the screen in a special
STA LINEBUF,Y buffer
DEY Screen column number-1
BPL SAVLOOP Done yet? No
JSR UNPATCH Restore a normal CHRGET
JSR SETNORM Set NORMAL screen mode
LDA #$01 Applesoft outputing
STA SPDBYTE at SPEED=255
LDA #COUT1 Disconnect DOS output
STA CSW vector we can trace
LDA #>COUT1 through a DOS command's
STA CSW+1 execution
LDA #23 Tab the cursor down
JSR TABV down to line 23
LDA #$00
STA CH column 0
JSR CLREOP Clear the line
;
; Check conditional trap points
;
CHKCON LDY #$05 Start with last trap
CHKCON1 LDA CFLAG,Y Get trap's status flag
BEQ CHKCON2 0=Trap not set, 1=Active trap
STY TRAP Save trap number
JSR CALCADR Calc. buffer address
JSR FRMEVL Evaluate conditional
LDA FAC And the results are...
BNE CONTRAP the trap was sprung
LDY TRAP False condition
CHKCON2 DEY try next trap
BPL CHKCON1 End of traps list? No
;
; Check unconditional trap points
;
LDY #$05 Start with last trap
CHKUNC LDA UNFLAG,Y Get trap's status
BEQ CHKUNC1 Skip inactive traps
LDA CURLIN Use a 16-bit comparison
CMP TRAPLO,Y to see if we should be
LDA CURLIN+1 stopping the program
SBC TRAPHI,Y
BEQ UNCTRAP Yes, trap this line
CHKUNC1 DEY Trap number-1
BPL CHKUNC Done checking? No
;
; Check for a trace variable
;
LDA TVAR Is there a variable?
BEQ PRLINE No, check conditional
LDA #CRSUP Install a CR suppressor
STA CSW output intercept
LDA #>CRSUP
STA CSW+1
LDA #VARBUF Point AppleSoft's
STA TXTPTR text pointer at
LDY #>VARBUF variable storage
STY TXTPTR+1 buffer
JSR STROUT Print the name
LDA #'=' Print an =
JSR OUTDO
JSR PRINT Print the value
LDA #COUT1 Reconnect the COUT1
STA CSW output vector
LDA #>COUT1
STA CSW+1
JSR INPRT Tell line number
JSR PATCH Restore patch is CHRGET
;
; Print the line number
;
PRLINE LDA TVAR Do we need to?
BNE EXIT No, just exit
JSR LINPRT Print the line #
EXIT LDX #$12 Delay routine
EXIT1 LDY #$FF
EXIT2 DEY
BNE EXIT2
DEX
BPL EXIT1
LDY #39 Restore the bottom line
RESLOOP LDA LINEBUF,Y
STA $7D0,Y
DEY Loop counter-1
BPL RESLOOP Done yet? No
LDX #$00 Restore the zero
EXIT4 LDA ZPAGE,X page values
STA $00,X
INX
BNE EXIT4
JMP MONIT1 Exit the monitor
;
; Do a conditional trap
;
CONTRAP JSR PRNTCON Print the condition
JMP LEAVE and exit to AppleSoft
;
; Do an unconditional trap
;
UNCTRAP LDA #TRAPPED Print out the
LDY #>TRAPPED TRAPPED message
JSR STROUT
LEAVE JSR INPRT Tell line # of trap
JSR BELL Sound the error tone
JMP RESET Exit to Applesoft
;
; CR suppressor routine
;
CRSUP CMP #$8D CR going out?
BEQ CRSUP2 Yes
STY YREG Save (Y)
LDY CH Check cursor position
CPY #30 Column 30 yet?
BCS CRSUP1 Yes, truncate the output
LDY YREG Restore (Y)
JMP COUT1 Output anything but CR
CRSUP1 LDY YREG
JSR SETINV Set inverse video
CRSUP2 RTS Igore the CR
****************************************************************
*
* Disconnect Super TRACE
*
****************************************************************
*
DISCON JSR UNPATCH Restore CHRGET code
JSR SETKBD Unhook input routine
LDX WARMST+1 This stuff will
LDA WARMST+2 disconnect the
STX SOFTEV Control RESET
STA SOFTEV+1 trap routine
JSR SETPWRC Validate vector change
LDA $BF00 Check for ProDOS again
CMP #$4C (INSTALL has comments)
BNE DISCON1
JSR FREEBUF Restore HIMEM
JMP DISCON2 Go wave good-bye
DISCON1 LDA #$00 Restore the normal
STA HIMEM (boot up) HIMEM
LDA #$96 address. (38400)
STA HIMEM+1
DISCON2 LDA #BYE Setup to print out
LDY #>BYE "GOODBYE"
JSR STROUT Print it
JMP WARMST Exit
****************************************************************
*
* Set a conditional trap point
*
****************************************************************
*
SETCON LDY #$00 This loop will try to
SETCON1 LDA CFLAG,Y find an open conditional
BEQ SETCON2 trap buffer -- Found
INY Check next trap
CPY #$06 Checked all traps?
BNE SETCON1 Nope, not yet
BEQ FULL Yep, buffers are full
SETCON2 STY TRAP Save the trap number
SETCON3 JSR CRDO Neaten things up
LDA #CONDIT Ask the user for the
LDY #>CONDIT trap condition
JSR STROUT Print the string
JSR INLIN Get the input
LDA INBUF Check for null input
BEQ DONE
JSR TXTBUF Position text pointer
JSR PARSE Tokenize the input
CPY #19+5 Condition too long?
BCS SETCON3 Yep, re-prompt user
LDY #$00 This loop check for
STY TEMP TEMP is token flag
SETCON4 LDA INBUF,Y validate condition
BEQ SETCON6 entry. Invalidate
BMI SETCON9 Token found
SETCON5 INY Next char
BNE SETCON4 Always taken
SETCON6 LDA TEMP TEMP is token found flag
BEQ SETCON3 Invalidate entry made
JSR CALCADR Calc. buffer address
LDY #$00 This loop stores the
SETCON7 LDA INBUF,Y in its buffer area
STA (MOVDST),Y
BEQ SETCON8 $00 when done storing
INY Kick up index
BNE SETCON7 Always taken
SETCON8 LDY TRAP Get trap number
LDA #$01 Mark trap as "USED"
STA CFLAG,Y
BNE DONE We're all done
SETCON9 CMP #$C2 FN token is valid
BEQ SETCON10 Go set flag
CMP #$C6 NOT token is valid
BEQ SETCON10 Set the token flag
CMP #$C8 This stuff will handle
BCC SETCON3 a block of validate tokens
SETCON10 LDA #$01 Set token flag
STA TEMP
BNE SETCON5 Continue checking entry
****************************************************************
*
* Set an unconditional trap point
*
****************************************************************
*
SETUNC LDY #$00 This loop will try to
SETUNC1 LDA UNFLAG,Y find an open unconditional
BEQ SETUNC2 trap buffer -- Found
INY Check next trap
CPY #$06 Checked all traps?
BNE SETUNC1 Nope, not yet
FULL LDA #TBFULL Setup to print out
LDY #>TBFULL "TRAP BUFFERS FULL"
JSR STROUT Print the message
JMP RESET Exit
SETUNC2 STY TRAP Save the trap number
SETUNC3 LDA #LINE Setup to print out
LDY #>LINE "LINE TO TRAP?"
JSR STROUT Print the prompt
JSR CONVERT Get and convert input
BCS SETUNC3 Carry set if input error
LDY TRAP Restore trap number
LDA MOVEND Save the line number
STA TRAPLO,Y in the unconditional
LDA MOVEND+1 trap buffer
STA TRAPHI,Y
LDA #$01 Mark trap as "USED"
STA UNFLAG,Y
DONE JMP RESET Exit via RESET handler
****************************************************************
*
* Remove unconditional trap
*
****************************************************************
*
REMOVUN JSR CRDO Print a CR
LDX #$00 This loop will print
REMOVUN1 LDA UNFLAG,X out all the active
BEQ REMOVUN2 traps. Skip--inactive
STX TRAP Save trap number
LDA #$00 Setup code -- PRDEC
JSR PRDEC Print trap number
LDA #'.' Print out a '.'
JSR OUTDO
LDA #$05 Set an HTAB of 6
STA CH
LDY TRAP Get trap number
LDX TRAPLO,Y Get trap value
LDA TRAPHI,Y
JSR PRDEC Print the trap value
JSR CRDO Print a CR
LDX TRAP Get trap number
REMOVUN2 INX Bump it up
CPX #$06 Done printing?
BNE REMOVUN1 Branch if not
REMOVUN3 LDA #REMOVE Ask the user for
LDY #>REMOVE number of trap
JSR STROUT to be removed
JSR CONVERT Get/convert input
BCS REMOVUN3 Conversion error
LDA MOVEND Check for a validate
CMP #$06 input range (0-6)
LDA MOVEND+1 with a 16-bit compare
SBC #$00
BCS REMOVUN3 Bad input made
LDX MOVEND Clear the trap
LDA #$00 $00 is UNFLAG means
STA UNFLAG,X trap is inactive
DONE2 JMP RESET Exit, we're done
****************************************************************
*
* Remove condional trap
*
****************************************************************
*
REMOVCN JSR CRDO Print a CR
LDX #$00 This loop will print
REMOVCN1 LDA CFLAG,X out all the active
BEQ REMOVCN2 traps. Skip--inactive
STX TRAP Save trap number
LDA #$00 Setup code -- PRDEC
JSR PRDEC Print trap number
LDA #'.' Print out a '.'
JSR OUTDO
LDY #$05 Set an HTAB of 6
STY CH
JSR CALCADR Calc. buffer address
JSR PRNTCON Print the condition
JSR CRDO Print a CR
LDX TRAP Get trap number
REMOVCN2 INX Bump it up
CPX #$06 Done printing?
BNE REMOVCN1 Branch if not
REMOVCN3 LDA #REMOVE Ask the user for
LDY #>REMOVE number of trap
JSR STROUT to be removed
JSR CONVERT Get/convert input
BCS REMOVCN3 Conversion error
LDA MOVEND Check for a validate
CMP #$06 input range (0-6)
LDA MOVEND+1 with a 16-bit compare
SBC #$00
BCS REMOVCN3 Bad input made
LDX MOVEND Clear the trap
LDA #$00 $00 is CFLAG means
STA CFLAG,X trap is inactive
BEQ DONE2 Exit, we're done
****************************************************************
*
* Enter a trace variable
*
****************************************************************
*
TRACE LDA #VARNAM Ask for the trace
LDY #>VARNAM variable name
JSR STROUT Print the prompt
JSR GETLIN Get the input
CPX #$07 Is name too big?
BCS TRACE Yep, re-prompt
CPX #$00 Null entry made?
BEQ TRACE6 Branch if yes
JSR FIXUP Fixup for parser
JSR TXTBUF Position text pointer
JSR PARSE Parse the input
LDY #$00 This loop checks to
TRACE1 LDA INBUF,Y be sure the user
BEQ TRACE2 didn't type in a
BMI TRACE invalidate name
INY Bump the index
BNE TRACE1 Always taken
TRACE2 LDY #$00 This loop copies
TRACE3 LDA INBUF,Y the name into
STA VARBUF,Y its buffer
BEQ TRACE4 $00 when done
INY Bump the index
BNE TRACE3 Always taken
TRACE4 LDA #$01 Trace variable on
TRACE5 STA TVAR
JMP RESET Exit
TRACE6 LDA #ONOFFTXT Ask user:
LDY #>ONOFFTXT "VARIABLE (O)N OR O(F)F?"
JSR STROUT Print prompt
JSR RDKEY Get input
AND #$DF Adjust the case
CMP #'O'+$80 'O' means on
BEQ TRACE4
CMP #'F'+$80 'F' means oFf
BNE TRACE6 Branch if bad input
LDA #$00 Variable off
BEQ TRACE5
****************************************************************
*
* Subroutines begin here
*
****************************************************************
*
;
; Position text pointer to input buffer
;
TXTBUF LDA #INBUF
STA TXTPTR
LDA #>INBUF
STA TXTPTR+1
RTS
;
; Convert a decimal number
;
; This routine was based on
; DOS 3.3 base converison
; routine - Disassembled
; in Nibble vol 4/Num 5
;
CONVERT JSR GETLIN Get the input
CPX #$00 Null input made?
BNE CONVERT0 Nope, continue
JMP RESET Exit via RESET
CONVERT0 LDX #$00 (X) is now $00
STX MOVEND Clear the number hold
STX MOVEND+1
STX MOVDST Clear INBUF index
CONVERT1 JSR CONVERT5 Get a digit from INBUF
BEQ CONVERT3 Exit if zero bit on
SEC Do validity check
SBC #$B0 ASCII to hex digit
BMI CONVERT2 Error if digit<0
CMP #$0A Digit greater then 9?
BCS CONVERT2 Branch if error
JSR CONVERT4 Digit * 2
ADC MOVEND dd digit to MOVEND
TAX X=MOVEND+1 + digit
LDA #$00 Do high byte of addition
ADC MOVEND+1 Handles any carries
TAY Y=MOVEND+1 * 2
JSR CONVERT4 MOVEND+1 * 4
JSR CONVERT4 MOVEND+1 * 8
TXA
ADC MOVEND Add up MOVEND * 2 + digit
STA MOVEND
TYA
ADC MOVEND+1 Add MOVEND+1 * 2
STA MOVEND+1
BCC CONVERT1 Continue conversion
CONVERT2 SEC Set carry flags an error
RTS Exit if conversion error
CONVERT3 CLC No error in conversion
RTS Exit cleanly
CONVERT4 ASL MOVEND MOVEND * 2 (16-bit)
ROL MOVEND+1
RTS
CONVERT5 LDX MOVDST Get input buffer index
LDA INBUF,X Get a digit
CMP #$8D Check for CR
BEQ CONVERT3 Exit if CR
INX Bump line index
STX MOVDST Store the index
RTS Exit CONVERT
;
; Calcualate the address of a
; conditional trap buffer
;
CALCADR LDA #CONBUF Point the text pointer
STA TXTPTR at the start of the
LDA #>CONBUF conditional buffers
STA TXTPTR+1
LDX TRAP Get trap number in X
CALCADR1 DEX Trap number - 1
BMI CALCADR2 Branch when done
LDY #20 Add 20 to address
JSR ADDON (Stored in TXTPTR)
JMP CALCADR1 Go to top of loop
CALCADR2 LDA TXTPTR Save the address
STA MOVDST also in MOVDST
LDA TXTPTR+1
STA MOVDST+1
RTS
;
; Print a conditional
;
; Based on the Applesoft
; LIST command handler -
; Disassembled in Nibble
; vol 4/num 4
;
PRNTCON LDY #$00 Zero the data index
PRNTCON1 LDA (MOVDST),Y Get byte from condition
BMI PRNTCON3 Branch if a token value
BEQ PRNTCON9 Exit on $00 byte
JSR OUTDO Print ASCII char
PRNTCON2 INY Bump the data index
BNE PRNTCON1 Always taken
PRNTCON3 STY TEMP Save Y's value
LDY #$D0 Setup the keyword
STY DSCTMP table pointer to
DEY $CFD0. Y=$CF
STY DSCTMP+1
LDY #$FF Set char index
SEC Trim token to keyword
SBC #$7F number (1=END...127=MID$)
TAX Move number to X
PRNTCON4 DEX Table number - 1
BEQ PRNTCON6 Branch when found
PRNTCON5 JSR KEYCHR This loop will skip
BPL PRNTCON5 the unwanted keywords
BMI PRNTCON4 Last char of word is ASCII
PRNTCON6 JSR OUTSP Print a leading space
PRNTCON7 JSR KEYCHR Get keyword char
BMI PRNTCON8 Branch if last letter
JSR OUTDO Print non final letter
BNE PRNTCON7 Continue printing word
PRNTCON8 JSR OUTDO Print last letter
LDY TEMP Restore index
JSR OUTSP Print a trailing space
BNE PRNTCON2 Continue with line
PRNTCON9 RTS Exit
;
; Patch the CHRGET routine
;
PATCH ENTRY Define the entry point
LDA #$4C Put a JMP in the
STA POINT CHRGET subroutine
LDA #MONIT the execution monitor
STA POINT+1 will be called by
LDA #>MONIT Applesoft
STA POINT+2
RTS
;
; Unpatch the CHRGET routine
;
UNPATCH LDA #$E6 $E6 is INC opcode
STA POINT Put it back in CHRGET
LDA #TXTPTR Operand of INC opcode
STA POINT+1
LDA #$D0 $D0 is BNE opcode
STA POINT+2
RTS
;
; Program data storage area
;
;
; Super TRACE commands table
; ^D^O^N
CMDSTBL DC H'848F8E'
; ^R^S^T
DC H'929394'
;
; Command handler jump table
;
ADRTBL DC A'DISCON-1'
DC A'SETCON-1'
DC A'SETUNC-1'
DC A'REMOVUN-1'
DC A'REMOVCN-1'
DC A'TRACE-1'
;
; Program's textual data
;
CONDIT DC C'CONDITION:',H'00'
TRAPPED DC C'TRAPPED',H'00'
BYE DC H'8D',C'GOODBYE',H'8D00'
LINE DC H'8D',C'LINE TO TRAP?',H'00'
VARNAM DC H'8D',C'VARIABLE NAME?',H'00'
ONOFFTXT DC C'VARIABLE (O)N OR O(F)F?',H'00'
REMOVE DC H'8D',C'TRAP TO REMOVE?',H'00'
TBFULL DC H'8D',C'TRAP BUFFERS FULL',H'878D00'
;
; Program's data buffers
;
;
LINEBUF DS 40 Screen line buffer
CFLAG DS 6 Status of conditional traps
UNFLAG DS 6 Status of unconditional traps
TRAPLO DS 6 Trapped line number low byte
TRAPHI DS 6 Trapped line number high byte
VARBUF DS 9 Trace variable name storage
CONBUF DS 20*6 Conditional trap buffer
ZPAGE DS 256 Zero page storage buffer
OBJEND End of main program
END ANOP
MAIN END End of source code